package com.feriaderemates.dao.user;

import com.feriaderemates.domain.userAccount.State;
import com.feriaderemates.domain.userAccount.UserAddress;
import com.feriaderemates.domain.userAccount.UserAddressType;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;

public class UserAddressRowMapper implements RowMapper {

	@Override
	public Object mapRow(ResultSet rs, int i) throws SQLException {
		UserAddress userAddress = new UserAddress(
				rs.getString("street_1"), rs.getString("street_2"),
				rs.getString("zip_Code"),rs.getString("neighborhood") ,
				rs.getString("city"), State.AGUAS_VAL, 
				UserAddressType.valueOf(rs.getString("address_type")),
				rs.getInt("user_Id"));
		return userAddress;
	}

	

}
